<template>
    <div class="wh-100" style="background-color: white">
        <div class="h-10 bor-base-b py-32 pl-24 fw-6 fs-18">文件上传历史</div>
        <div class="h-80 bor-base-b">
            <div class="h-10 d-flex bor-base-b">
                <div class="w-15 py-12 pl-24 mr-auto">
                    <el-button>导出数据</el-button>
                </div>
            </div>
            <div class="h-90">
                <el-table v-loading="loading" empty-text="暂无数据" :data="tableData" style="width: 100%">
                    <el-table-column prop="fileName" label="文件名" width="180"></el-table-column>
                    <el-table-column prop="filePath" label="文件路径" width="180"></el-table-column>
                    <el-table-column prop="status" label="上传状态"></el-table-column>
                    <el-table-column prop="isSuccess" label="是否成功">
                        <template slot-scope="scope">
                            <span v-if="scope.row.isSuccess === true">是</span>
                            <span v-else>否</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="message" label="导入结果信息"></el-table-column>
                    <el-table-column prop="createTime" label="创建时间"></el-table-column>
                </el-table>
            </div>
        </div>
        <!--分页-->
        <div class="h-10 d-flex-center fs-14">
            <Page show-sizer :total="pageTotal" :current="pageParams.pageNumber" :page-size="pageParams.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" show-elevator />
        </div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            loading: false,
            modelState: '全部',
            pageTotal: 0,
            pageParams: {
                pageNumber: 1,
                pageSize: 10
            },
            stateSelection: [
                {
                    label: '待审核',
                    value: 'toBeReviewed'
                },
                {
                    label: '已通过',
                    value: 'alreadyPassed'
                },
                {
                    label: '已拒绝',
                    value: 'declined'
                }
            ],
            modelPosition: '',
            positionSelection: [],
            tableData: [],
            tableColumns: [
                { prop: 'fileName', label: '文件名' },
                { prop: 'filePath', label: '文件路径' },
                { prop: 'status', label: '上传状态' },
                { prop: '职位名称', label: '学校类型' },
                { prop: 'status', label: '上传状态' },
                { prop: 'status', label: '上传状态' }
            ]
        };
    },
    mounted() {
        this.getList();
    },
    methods: {
        yesThroughState: function (data) {
            return data.state === '已通过' ? true : false;
        },
        toBeReviewed: function (data) {
            return data.state === '待审核' ? true : false;
        },
        declined: function (data) {
            return data.state === '已拒绝' ? true : false;
        },
        getList() {
            console.log('查询');
        },
        // region TODO 分页
        changePage(val) {
            this.pageParams.pageNumber = val;
            //调接口
            this.getList();
        },
        changePageSize(val) {
            this.pageParams.pageSize = val;
            //调接口
            this.getList();
        }
        // endregion
    }
};
</script>
